#!/usr/bin/env bash

while IFS= read -r line
do
  key=$(echo "$line" | sed -n 's/^\[RESULT\]\[\([^[]*\)\][^[]*\[\([^[]*\)\].*$/\1/p' | sed 's/ /_/g')
  value=$(echo "$line" | sed -n 's/^\[RESULT\]\[\([^[]*\)\][^[]*\[\([^[]*\)\].*$/\2/p')
  [[ -n $value ]] && echo ".$key: $value"
done < "$RESULT_ROOT/stdout"

echo done